package com.d3works.apps.base.job;

import com.d3works.apps.base.service.currency.CurrencyConversionFactory;
import com.d3works.exception.D3worksException;
import com.google.inject.Inject;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class CurrencyConversionJob implements Job {

  @Inject protected CurrencyConversionFactory currencyConversionFactory;

  @Override
  public void execute(JobExecutionContext context) throws JobExecutionException {
    try {
      currencyConversionFactory.getCurrencyConversionService().updateCurrencyConverion();
    } catch (D3worksException e) {
      throw new JobExecutionException(e);
    }
  }
}
